3.1.30 \(\int \frac {(c+d x^2)^2}{(a+b x^2)^2} \, dx\)

Optimal. Leaf size=82 \[ \frac {(b c-a d) (3 a d+b c) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{3/2} b^{5/2}}+\frac {x (b c-a d)^2}{2 a b^2 \left (a+b x^2\right )}+\frac {d^2 x}{b^2} \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {390, 385, 205} \begin {gather*} \frac {(b c-a d) (3 a d+b c) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{3/2} b^{5/2}}+\frac {x (b c-a d)^2}{2 a b^2 \left (a+b x^2\right )}+\frac {d^2 x}{b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x^2)^2/(a + b*x^2)^2,x]

[Out]

(d^2*x)/b^2 + ((b*c - a*d)^2*x)/(2*a*b^2*(a + b*x^2)) + ((b*c - a*d)*(b*c + 3*a*d)*ArcTan[(Sqrt[b]*x)/Sqrt[a]]
)/(2*a^(3/2)*b^(5/2))

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rubi steps

\begin {align*} \int \frac {\left (c+d x^2\right )^2}{\left (a+b x^2\right )^2} \, dx &=\int \left (\frac {d^2}{b^2}+\frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{b^2 \left (a+b x^2\right )^2}\right ) \, dx\\ &=\frac {d^2 x}{b^2}+\frac {\int \frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{\left (a+b x^2\right )^2} \, dx}{b^2}\\ &=\frac {d^2 x}{b^2}+\frac {(b c-a d)^2 x}{2 a b^2 \left (a+b x^2\right )}+\frac {((b c-a d) (b c+3 a d)) \int \frac {1}{a+b x^2} \, dx}{2 a b^2}\\ &=\frac {d^2 x}{b^2}+\frac {(b c-a d)^2 x}{2 a b^2 \left (a+b x^2\right )}+\frac {(b c-a d) (b c+3 a d) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{3/2} b^{5/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 88, normalized size = 1.07 \begin {gather*} \frac {\left (-3 a^2 d^2+2 a b c d+b^2 c^2\right ) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{3/2} b^{5/2}}+\frac {x (b c-a d)^2}{2 a b^2 \left (a+b x^2\right )}+\frac {d^2 x}{b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^2)^2/(a + b*x^2)^2,x]

[Out]

(d^2*x)/b^2 + ((b*c - a*d)^2*x)/(2*a*b^2*(a + b*x^2)) + ((b^2*c^2 + 2*a*b*c*d - 3*a^2*d^2)*ArcTan[(Sqrt[b]*x)/
Sqrt[a]])/(2*a^(3/2)*b^(5/2))

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (c+d x^2\right )^2}{\left (a+b x^2\right )^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(c + d*x^2)^2/(a + b*x^2)^2,x]

[Out]

IntegrateAlgebraic[(c + d*x^2)^2/(a + b*x^2)^2, x]

________________________________________________________________________________________

fricas [A]  time = 0.95, size = 297, normalized size = 3.62 \begin {gather*} \left [\frac {4 \, a^{2} b^{2} d^{2} x^{3} + {\left (a b^{2} c^{2} + 2 \, a^{2} b c d - 3 \, a^{3} d^{2} + {\left (b^{3} c^{2} + 2 \, a b^{2} c d - 3 \, a^{2} b d^{2}\right )} x^{2}\right )} \sqrt {-a b} \log \left (\frac {b x^{2} + 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) + 2 \, {\left (a b^{3} c^{2} - 2 \, a^{2} b^{2} c d + 3 \, a^{3} b d^{2}\right )} x}{4 \, {\left (a^{2} b^{4} x^{2} + a^{3} b^{3}\right )}}, \frac {2 \, a^{2} b^{2} d^{2} x^{3} + {\left (a b^{2} c^{2} + 2 \, a^{2} b c d - 3 \, a^{3} d^{2} + {\left (b^{3} c^{2} + 2 \, a b^{2} c d - 3 \, a^{2} b d^{2}\right )} x^{2}\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} x}{a}\right ) + {\left (a b^{3} c^{2} - 2 \, a^{2} b^{2} c d + 3 \, a^{3} b d^{2}\right )} x}{2 \, {\left (a^{2} b^{4} x^{2} + a^{3} b^{3}\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/(b*x^2+a)^2,x, algorithm="fricas")

[Out]

[1/4*(4*a^2*b^2*d^2*x^3 + (a*b^2*c^2 + 2*a^2*b*c*d - 3*a^3*d^2 + (b^3*c^2 + 2*a*b^2*c*d - 3*a^2*b*d^2)*x^2)*sq
rt(-a*b)*log((b*x^2 + 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) + 2*(a*b^3*c^2 - 2*a^2*b^2*c*d + 3*a^3*b*d^2)*x)/(a^2*b
^4*x^2 + a^3*b^3), 1/2*(2*a^2*b^2*d^2*x^3 + (a*b^2*c^2 + 2*a^2*b*c*d - 3*a^3*d^2 + (b^3*c^2 + 2*a*b^2*c*d - 3*
a^2*b*d^2)*x^2)*sqrt(a*b)*arctan(sqrt(a*b)*x/a) + (a*b^3*c^2 - 2*a^2*b^2*c*d + 3*a^3*b*d^2)*x)/(a^2*b^4*x^2 +
a^3*b^3)]

________________________________________________________________________________________

giac [A]  time = 0.58, size = 94, normalized size = 1.15 \begin {gather*} \frac {d^{2} x}{b^{2}} + \frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a b^{2}} + \frac {b^{2} c^{2} x - 2 \, a b c d x + a^{2} d^{2} x}{2 \, {\left (b x^{2} + a\right )} a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/(b*x^2+a)^2,x, algorithm="giac")

[Out]

d^2*x/b^2 + 1/2*(b^2*c^2 + 2*a*b*c*d - 3*a^2*d^2)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a*b^2) + 1/2*(b^2*c^2*x - 2
*a*b*c*d*x + a^2*d^2*x)/((b*x^2 + a)*a*b^2)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 129, normalized size = 1.57 \begin {gather*} \frac {a \,d^{2} x}{2 \left (b \,x^{2}+a \right ) b^{2}}-\frac {3 a \,d^{2} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \sqrt {a b}\, b^{2}}+\frac {c^{2} x}{2 \left (b \,x^{2}+a \right ) a}+\frac {c^{2} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \sqrt {a b}\, a}-\frac {c d x}{\left (b \,x^{2}+a \right ) b}+\frac {c d \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}\, b}+\frac {d^{2} x}{b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x^2+c)^2/(b*x^2+a)^2,x)

[Out]

1/b^2*d^2*x+1/2/b^2*a*x/(b*x^2+a)*d^2-1/b*x/(b*x^2+a)*c*d+1/2/a*x/(b*x^2+a)*c^2-3/2/b^2*a/(a*b)^(1/2)*arctan(1
/(a*b)^(1/2)*b*x)*d^2+1/b/(a*b)^(1/2)*arctan(1/(a*b)^(1/2)*b*x)*c*d+1/2/a/(a*b)^(1/2)*arctan(1/(a*b)^(1/2)*b*x
)*c^2

________________________________________________________________________________________

maxima [A]  time = 2.84, size = 95, normalized size = 1.16 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x}{2 \, {\left (a b^{3} x^{2} + a^{2} b^{2}\right )}} + \frac {d^{2} x}{b^{2}} + \frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/(b*x^2+a)^2,x, algorithm="maxima")

[Out]

1/2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*x/(a*b^3*x^2 + a^2*b^2) + d^2*x/b^2 + 1/2*(b^2*c^2 + 2*a*b*c*d - 3*a^2*d^2
)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a*b^2)

________________________________________________________________________________________

mupad [B]  time = 5.06, size = 124, normalized size = 1.51 \begin {gather*} \frac {d^2\,x}{b^2}+\frac {x\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,a\,\left (b^3\,x^2+a\,b^2\right )}+\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,x\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{\sqrt {a}\,\left (-3\,a^2\,d^2+2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{2\,a^{3/2}\,b^{5/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x^2)^2/(a + b*x^2)^2,x)

[Out]

(d^2*x)/b^2 + (x*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d))/(2*a*(a*b^2 + b^3*x^2)) + (atan((b^(1/2)*x*(a*d - b*c)*(3*a*
d + b*c))/(a^(1/2)*(b^2*c^2 - 3*a^2*d^2 + 2*a*b*c*d)))*(a*d - b*c)*(3*a*d + b*c))/(2*a^(3/2)*b^(5/2))

________________________________________________________________________________________

sympy [B]  time = 0.72, size = 236, normalized size = 2.88 \begin {gather*} \frac {x \left (a^{2} d^{2} - 2 a b c d + b^{2} c^{2}\right )}{2 a^{2} b^{2} + 2 a b^{3} x^{2}} + \frac {\sqrt {- \frac {1}{a^{3} b^{5}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (- \frac {a^{2} b^{2} \sqrt {- \frac {1}{a^{3} b^{5}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} - \frac {\sqrt {- \frac {1}{a^{3} b^{5}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (\frac {a^{2} b^{2} \sqrt {- \frac {1}{a^{3} b^{5}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} + \frac {d^{2} x}{b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x**2+c)**2/(b*x**2+a)**2,x)

[Out]

x*(a**2*d**2 - 2*a*b*c*d + b**2*c**2)/(2*a**2*b**2 + 2*a*b**3*x**2) + sqrt(-1/(a**3*b**5))*(a*d - b*c)*(3*a*d
+ b*c)*log(-a**2*b**2*sqrt(-1/(a**3*b**5))*(a*d - b*c)*(3*a*d + b*c)/(3*a**2*d**2 - 2*a*b*c*d - b**2*c**2) + x
)/4 - sqrt(-1/(a**3*b**5))*(a*d - b*c)*(3*a*d + b*c)*log(a**2*b**2*sqrt(-1/(a**3*b**5))*(a*d - b*c)*(3*a*d + b
*c)/(3*a**2*d**2 - 2*a*b*c*d - b**2*c**2) + x)/4 + d**2*x/b**2

________________________________________________________________________________________